import { defHttp } from '/@/utils/http/axios';
import { ContentTypeEnum } from '/@/enums/httpEnum';

enum Api {
  getpostList = '/admin-api/system/post/page',
  getpostAdd = '/admin-api/system/post/create',
  getpostEdit = '/admin-api/system/post/update',
  getpostDelete = '/admin-api/system/post/delete',
}

/**
 * @description: 获用户
 */
export const postList = (params: any) => {
  return defHttp.get<any>({ url: Api.getpostList, params });
};
export const addPost = (params: any) => {
  return defHttp.post<any>({ url: Api.getpostAdd, params });
};
export const editPost = (params: any) => {
  return defHttp.put<any>({ url: Api.getpostEdit, params });
};
export const deletePost = (params: any) => {
  return defHttp.delete<any>({
    url: Api.getpostDelete,
    params,
    headers: { 'Content-Type': ContentTypeEnum.FORM_URLENCODED },
  });
};
